package com.qc.wintrax.fragment;

import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.qc.wintrax.R;
import com.qc.wintrax.activity.GPSInfoActivity;
import com.qc.wintrax.activity.SettingActivity;
import com.qc.wintrax.activity.SignAndSigterActivity;
import com.qc.wintrax.widget.CheckSwitchButton;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @author xiaobaodou
 * @Description:(添加会议成员) create at  2016/7/14 17:05
 **/
public class MineFragment extends BaseFragment {
    @Bind(R.id.mCheck_lastview)
    CheckSwitchButton mCheckLastview;
    @Bind(R.id.mCheck_coordview)
    CheckSwitchButton mCheckCoordview;
    @Bind(R.id.mCheck_showlangue)
    CheckSwitchButton mCheckShowlangue;
    @Bind(R.id.version_view)
    TextView versionView;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.tab04, container, false);
        ButterKnife.bind(this, view);
        versionView.setText(getVersion());
        return view;


    }

    /**
     * 获取版本号
     *
     * @return 当前应用的版本号
     */
    public String getVersion() {
        try {
            PackageManager manager = getActivity().getPackageManager();
            PackageInfo info = manager.getPackageInfo(getActivity().getPackageName(), 0);
            String version = info.versionName;
            return  version;
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    @Override
    public void onStop() {
        super.onStop();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }


//    @OnClick({R.id.sign_register, R.id.setting_layout, R.id.attention_layout, R.id.thumb_up_layout,})
//    public void onClick(View view) {
//        switch (view.getId()) {
//            case R.id.sign_register:
//                Intent sign = new Intent(getActivity(), SignAndSigterActivity.class);
//                startActivity(sign);
//                break;
//            case R.id.setting_layout:
//                Intent setting = new Intent(getActivity(), SettingActivity.class);
//                startActivity(setting);
//                break;
//            case R.id.attention_layout:
//                Intent attention = new Intent(getActivity(), GPSInfoActivity.class);
//                startActivity(attention);
//                break;
//            case R.id.thumb_up_layout:
//                break;
//
//        }
//    }

//    @Override
//    protected void lazyLoad() {
//
//    }
}
